package com.smartphonedev.activity;

import android.app.TabActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;


public class MainActivity extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE); 
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		setContentView(R.layout.main);
		TabHost th = getTabHost();

		// Tab 1
		TabSpec tab1spec = th.newTabSpec(getString(R.string.positioning));
		// setting Title and Icon for the Tab
		tab1spec.setIndicator(getString(R.string.positioning), getResources().getDrawable(R.drawable.icon_tab1));
		Intent mapIntent = new Intent(this, TestTab1Activity.class);
		tab1spec.setContent(mapIntent);

		// Tab 2
		TabSpec tab2spec = th.newTabSpec(getString(R.string.tracking));
		tab2spec.setIndicator(getString(R.string.tracking), getResources().getDrawable(R.drawable.icon_tab2));
		Intent tab2Intent = new Intent(this, Tab2Activity.class);
		tab2spec.setContent(tab2Intent);

		// Tab 3
		TabSpec tab3spec = th.newTabSpec(getString(R.string.history));
		tab3spec.setIndicator(getString(R.string.history), getResources().getDrawable(R.drawable.icon_tab3));
		Intent tab3Intent = new Intent(this, Tab3Activity.class);
		tab3spec.setContent(tab3Intent);
		// Tab 4
		TabSpec tab4spec = th.newTabSpec(getString(R.string.connect));
		tab4spec.setIndicator(getString(R.string.connect), getResources().getDrawable(R.drawable.icon_tab4));
		Intent tab4Intent = new Intent(this, Tab4Activity.class);
		tab4spec.setContent(tab4Intent);

		// Adding all TabSpec to TabHost
		th.addTab(tab1spec); // Adding tab 1
		th.addTab(tab2spec); // Adding tab 2
		th.addTab(tab3spec); // Adding tab 3
		th.addTab(tab4spec); // Adding tab 3
	}
}


